package abs.dao;

import abs.domain.TipoClientes;

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.skyway.spring.util.dao.AbstractJpaDao;

import org.springframework.dao.DataAccessException;

import org.springframework.stereotype.Repository;

import org.springframework.transaction.annotation.Transactional;

/**
 * DAO to manage TipoClientes entities.
 * 
 */
@Repository("TipoClientesDAO")
@Transactional
public class TipoClientesDAOImpl extends AbstractJpaDao<TipoClientes> implements
		TipoClientesDAO {

	/**
	 * Set of entity classes managed by this DAO.  Typically a DAO manages a single entity.
	 *
	 */
	private final static Set<Class<?>> dataTypes = new HashSet<Class<?>>(Arrays.asList(new Class<?>[] { TipoClientes.class }));

	/**
	 * EntityManager injected by Spring for persistence unit absV2
	 *
	 */
	@PersistenceContext(unitName = "absV2")
	private EntityManager entityManager;

	/**
	 * Instantiates a new TipoClientesDAOImpl
	 *
	 */
	public TipoClientesDAOImpl() {
		super();
	}

	/**
	 * Get the entity manager that manages persistence unit 
	 *
	 */
	@Override
	public EntityManager getEntityManager() {
		return entityManager;
	}

	/**
	 * Returns the set of entity classes managed by this DAO.
	 *
	 */
	@Override
	public Set<Class<?>> getTypes() {
		return dataTypes;
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100cdgo
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100cdgo(String tipocl100cdgo) throws DataAccessException {

		return findTipoClientesByTipocl100cdgo(tipocl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100cdgo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100cdgo(String tipocl100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100cdgo", startResult, maxRows, tipocl100cdgo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100lomo
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100lomo(String tipocl100lomo) throws DataAccessException {

		return findTipoClientesByTipocl100lomo(tipocl100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100lomo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100lomo(String tipocl100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100lomo", startResult, maxRows, tipocl100lomo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femo
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femo(java.util.Calendar tipocl100femo) throws DataAccessException {

		return findTipoClientesByTipocl100femo(tipocl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femo
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femo(java.util.Calendar tipocl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100femo", startResult, maxRows, tipocl100femo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100fead
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100fead(java.util.Calendar tipocl100fead) throws DataAccessException {

		return findTipoClientesByTipocl100fead(tipocl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100fead
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100fead(java.util.Calendar tipocl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100fead", startResult, maxRows, tipocl100fead);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100nociaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100nociaContaining(String tipocl100nocia) throws DataAccessException {

		return findTipoClientesByTipocl100nociaContaining(tipocl100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100nociaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100nociaContaining(String tipocl100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100nociaContaining", startResult, maxRows, tipocl100nocia);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100desc
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100desc(String tipocl100desc) throws DataAccessException {

		return findTipoClientesByTipocl100desc(tipocl100desc, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100desc
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100desc(String tipocl100desc, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100desc", startResult, maxRows, tipocl100desc);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100nocia
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100nocia(String tipocl100nocia) throws DataAccessException {

		return findTipoClientesByTipocl100nocia(tipocl100nocia, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100nocia
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100nocia(String tipocl100nocia, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100nocia", startResult, maxRows, tipocl100nocia);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100descContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100descContaining(String tipocl100desc) throws DataAccessException {

		return findTipoClientesByTipocl100descContaining(tipocl100desc, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100descContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100descContaining(String tipocl100desc, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100descContaining", startResult, maxRows, tipocl100desc);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100cdgoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100cdgoContaining(String tipocl100cdgo) throws DataAccessException {

		return findTipoClientesByTipocl100cdgoContaining(tipocl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100cdgoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100cdgoContaining(String tipocl100cdgo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100cdgoContaining", startResult, maxRows, tipocl100cdgo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByPrimaryKey
	 *
	 */
	@Override
	@Transactional
	public TipoClientes findTipoClientesByPrimaryKey(String tipocl100nocia, String tipocl100cdgo) throws DataAccessException {

		return findTipoClientesByPrimaryKey(tipocl100nocia, tipocl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByPrimaryKey
	 *
	 */

	@Override
	@Transactional
	public TipoClientes findTipoClientesByPrimaryKey(String tipocl100nocia, String tipocl100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findTipoClientesByPrimaryKey", startResult, maxRows, tipocl100nocia, tipocl100cdgo);
			return (abs.domain.TipoClientes) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100lomoContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100lomoContaining(String tipocl100lomo) throws DataAccessException {

		return findTipoClientesByTipocl100lomoContaining(tipocl100lomo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100lomoContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100lomoContaining(String tipocl100lomo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100lomoContaining", startResult, maxRows, tipocl100lomo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100load
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100load(String tipocl100load) throws DataAccessException {

		return findTipoClientesByTipocl100load(tipocl100load, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100load
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100load(String tipocl100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100load", startResult, maxRows, tipocl100load);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100esta
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100esta(String tipocl100esta) throws DataAccessException {

		return findTipoClientesByTipocl100esta(tipocl100esta, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100esta
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100esta(String tipocl100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100esta", startResult, maxRows, tipocl100esta);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findAllTipoClientess
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findAllTipoClientess() throws DataAccessException {

		return findAllTipoClientess(-1, -1);
	}

	/**
	 * JPQL Query - findAllTipoClientess
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findAllTipoClientess(int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findAllTipoClientess", startResult, maxRows);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100feadAfter
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100feadAfter(java.util.Calendar tipocl100fead) throws DataAccessException {

		return findTipoClientesByTipocl100feadAfter(tipocl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100feadAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100feadAfter(java.util.Calendar tipocl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100feadAfter", startResult, maxRows, tipocl100fead);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100loadContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100loadContaining(String tipocl100load) throws DataAccessException {

		return findTipoClientesByTipocl100loadContaining(tipocl100load, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100loadContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100loadContaining(String tipocl100load, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100loadContaining", startResult, maxRows, tipocl100load);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100feadBefore
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100feadBefore(java.util.Calendar tipocl100fead) throws DataAccessException {

		return findTipoClientesByTipocl100feadBefore(tipocl100fead, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100feadBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100feadBefore(java.util.Calendar tipocl100fead, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100feadBefore", startResult, maxRows, tipocl100fead);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100estaContaining
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100estaContaining(String tipocl100esta) throws DataAccessException {

		return findTipoClientesByTipocl100estaContaining(tipocl100esta, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100estaContaining
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100estaContaining(String tipocl100esta, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100estaContaining", startResult, maxRows, tipocl100esta);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femoBefore
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femoBefore(java.util.Calendar tipocl100femo) throws DataAccessException {

		return findTipoClientesByTipocl100femoBefore(tipocl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femoBefore
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femoBefore(java.util.Calendar tipocl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100femoBefore", startResult, maxRows, tipocl100femo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * JPQL Query - findTipoClientesByPrimaryKey
	 *
	 */
	@Transactional
	public TipoClientes findTipoClientesByPrimaryKey(String tipocl100cdgo) throws DataAccessException {

		return findTipoClientesByPrimaryKey(tipocl100cdgo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByPrimaryKey
	 *
	 */

	@Transactional
	public TipoClientes findTipoClientesByPrimaryKey(String tipocl100cdgo, int startResult, int maxRows) throws DataAccessException {
		try {
			Query query = createNamedQuery("findTipoClientesByPrimaryKey", startResult, maxRows, tipocl100cdgo);
			return (abs.domain.TipoClientes) query.getSingleResult();
		} catch (NoResultException nre) {
			return null;
		}
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femoAfter
	 *
	 */
	@Override
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femoAfter(java.util.Calendar tipocl100femo) throws DataAccessException {

		return findTipoClientesByTipocl100femoAfter(tipocl100femo, -1, -1);
	}

	/**
	 * JPQL Query - findTipoClientesByTipocl100femoAfter
	 *
	 */

	@Override
	@SuppressWarnings("unchecked")
	@Transactional
	public Set<TipoClientes> findTipoClientesByTipocl100femoAfter(java.util.Calendar tipocl100femo, int startResult, int maxRows) throws DataAccessException {
		Query query = createNamedQuery("findTipoClientesByTipocl100femoAfter", startResult, maxRows, tipocl100femo);
		return new LinkedHashSet<TipoClientes>(query.getResultList());
	}

	/**
	 * Used to determine whether or not to merge the entity or persist the entity when calling Store
	 * @see store
	 * 
	 *
	 */
	@Override
	public boolean canBeMerged(TipoClientes entity) {
		return true;
	}
}
